package com.example.consumerservice;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Classname Consumer
 * @Description
 * @Author caozhenhao001
 * @Date 2024/3/25
 * @Version
 */

@Component
@RabbitListener(queuesToDeclare = @Queue(RabbitConstant.RABBITMQ_TOPIC))
public class ConsumerServiceImpl {

    @RabbitHandler
    public void process(String message){
        System.out.println("consumer接受消息： " + message);
    }
}
